﻿
package system.data;

import java.util.*;

import framework.core.*;
/*
	Author    :Jackey
	CreateTime:2008-03-03 10:44:25
*/
public class CheckSubBase extends Table 
{
public static final String TABLE_NAME = "T_CHECK_SUB";

private static final String BACKUP_TABLE_NAME = "T_CHECK_SUB_BACKUP";

private static final String BACKUP_SEQ_NAME = "S_CHECK_SUB_BACKUP";


public static final String ID = "ID";

public static final String CHECK_BILL_ID = "CHECK_BILL_ID";

public static final String CHECK_BILL_CODE = "CHECK_BILL_CODE";

public static final String POSITION_CODE = "POSITION_CODE";

public static final String POSITION_NAME = "POSITION_NAME";

public static final String PRODUCT_ID = "PRODUCT_ID";

public static final String PRODUCT_CODE = "PRODUCT_CODE";

public static final String PRODUCT_NAME = "PRODUCT_NAME";

public static final String POSITION_COUNT = "POSITION_COUNT";

public static final String ACTURE_COUNT = "ACTURE_COUNT";

public static final String STATUS = "STATUS";

public static final String CREATE_USER_ID = "CREATE_USER_ID";

public static final String CREATE_USER = "CREATE_USER";

public static final String CREATE_TIME = "CREATE_TIME";

public static final String LAST_UPDATE_USER_ID = "LAST_UPDATE_USER_ID";

public static final String LAST_UPDATE_USER = "LAST_UPDATE_USER";

public static final String LAST_UPDATE_TIME = "LAST_UPDATE_TIME";

public static final String IS_SYNC = "IS_SYNC";

public static final String SUB_REMARK = "SUB_REMARK";


public static Vector m_fields = null;


private String m_id = ""; //ID

private String m_check_bill_id = ""; //盘点单ID

private String m_check_bill_code = ""; //盘点单编码

private String m_position_code = ""; //货位编码

private String m_position_name = ""; //货位名称

private String m_product_id = ""; //产品ID

private String m_product_code = ""; //产品编码

private String m_product_name = ""; //产品名称

private double m_position_count = Value.NULL_DOUBLE; //货位库存数量

private double m_acture_count = Value.NULL_DOUBLE; //实际数量

private String m_status = ""; //是否有效

private String m_create_user_id = ""; //创建用户ID

private String m_create_user = ""; //创建用户

private String m_create_time = ""; //单证创建时间

private String m_last_update_user_id = ""; //最后修改人ID

private String m_last_update_user = ""; //最后修改人

private String m_last_update_time = ""; //最后修改时间

private String m_is_sync = ""; //是否同步

private String m_sub_remark = ""; //备注



	public String getId()
	{
	    return m_id;
	}
	public void  setId(String v)
	{
		if(getId().equals(v)) return ;
		m_id = v ;
		markDirty(ID);
	}



	

	public String getCheckBillId()
	{
	    return m_check_bill_id;
	}
	public void  setCheckBillId(String v)
	{
		if(getCheckBillId().equals(v)) return ;
		m_check_bill_id = v ;
		markDirty(CHECK_BILL_ID);
	}



	

	public String getCheckBillCode()
	{
	    return m_check_bill_code;
	}
	public void  setCheckBillCode(String v)
	{
		if(getCheckBillCode().equals(v)) return ;
		m_check_bill_code = v ;
		markDirty(CHECK_BILL_CODE);
	}



	

	public String getPositionCode()
	{
	    return m_position_code;
	}
	public void  setPositionCode(String v)
	{
		if(getPositionCode().equals(v)) return ;
		m_position_code = v ;
		markDirty(POSITION_CODE);
	}



	

	public String getPositionName()
	{
	    return m_position_name;
	}
	public void  setPositionName(String v)
	{
		if(getPositionName().equals(v)) return ;
		m_position_name = v ;
		markDirty(POSITION_NAME);
	}



	

	public String getProductId()
	{
	    return m_product_id;
	}
	public void  setProductId(String v)
	{
		if(getProductId().equals(v)) return ;
		m_product_id = v ;
		markDirty(PRODUCT_ID);
	}



	

	public String getProductCode()
	{
	    return m_product_code;
	}
	public void  setProductCode(String v)
	{
		if(getProductCode().equals(v)) return ;
		m_product_code = v ;
		markDirty(PRODUCT_CODE);
	}



	

	public String getProductName()
	{
	    return m_product_name;
	}
	public void  setProductName(String v)
	{
		if(getProductName().equals(v)) return ;
		m_product_name = v ;
		markDirty(PRODUCT_NAME);
	}



	

	public double getPositionCount()
	{
	    return m_position_count;
	}
	public void  setPositionCount(double v)
	{
		if(getPositionCount()==v) return ;
		m_position_count = v ;
		markDirty(POSITION_COUNT);
	}



	

	public double getActureCount()
	{
	    return m_acture_count;
	}
	public void  setActureCount(double v)
	{
		if(getActureCount()==v) return ;
		m_acture_count = v ;
		markDirty(ACTURE_COUNT);
	}



	

	public String getStatus()
	{
	    return m_status;
	}
	public void  setStatus(String v)
	{
		if(getStatus().equals(v)) return ;
		m_status = v ;
		markDirty(STATUS);
	}



	

	public String getCreateUserId()
	{
	    return m_create_user_id;
	}
	public void  setCreateUserId(String v)
	{
		if(getCreateUserId().equals(v)) return ;
		m_create_user_id = v ;
		markDirty(CREATE_USER_ID);
	}



	

	public String getCreateUser()
	{
	    return m_create_user;
	}
	public void  setCreateUser(String v)
	{
		if(getCreateUser().equals(v)) return ;
		m_create_user = v ;
		markDirty(CREATE_USER);
	}



	

	public String getCreateTime()
	{
	    return m_create_time;
	}
	public void  setCreateTime(String v)
	{
		if(getCreateTime().equals(v)) return ;
		m_create_time = v ;
		markDirty(CREATE_TIME);
	}



	

	public String getLastUpdateUserId()
	{
	    return m_last_update_user_id;
	}
	public void  setLastUpdateUserId(String v)
	{
		if(getLastUpdateUserId().equals(v)) return ;
		m_last_update_user_id = v ;
		markDirty(LAST_UPDATE_USER_ID);
	}



	

	public String getLastUpdateUser()
	{
	    return m_last_update_user;
	}
	public void  setLastUpdateUser(String v)
	{
		if(getLastUpdateUser().equals(v)) return ;
		m_last_update_user = v ;
		markDirty(LAST_UPDATE_USER);
	}



	

	public String getLastUpdateTime()
	{
	    return m_last_update_time;
	}
	public void  setLastUpdateTime(String v)
	{
		if(getLastUpdateTime().equals(v)) return ;
		m_last_update_time = v ;
		markDirty(LAST_UPDATE_TIME);
	}



	

	public String getIsSync()
	{
	    return m_is_sync;
	}
	public void  setIsSync(String v)
	{
		if(getIsSync().equals(v)) return ;
		m_is_sync = v ;
		markDirty(IS_SYNC);
	}



	

	public String getSubRemark()
	{
	    return m_sub_remark;
	}
	public void  setSubRemark(String v)
	{
		if(getSubRemark().equals(v)) return ;
		m_sub_remark = v ;
		markDirty(SUB_REMARK);
	}



	



	public String viewId(DBConnection con) throws Exception
	{
		return Value.view(getId());
	}

	public String viewCheckBillId(DBConnection con) throws Exception
	{
		return Value.view(getCheckBillId());
	}

	public String viewCheckBillCode(DBConnection con) throws Exception
	{
		return Value.view(getCheckBillCode());
	}

	public String viewPositionCode(DBConnection con) throws Exception
	{
		return Value.view(getPositionCode());
	}

	public String viewPositionName(DBConnection con) throws Exception
	{
		return Value.view(getPositionName());
	}

	public String viewProductId(DBConnection con) throws Exception
	{
		return Value.view(getProductId());
	}

	public String viewProductCode(DBConnection con) throws Exception
	{
		return Value.view(getProductCode());
	}

	public String viewProductName(DBConnection con) throws Exception
	{
		return Value.view(getProductName());
	}

	public String viewPositionCount(DBConnection con) throws Exception
	{
		return Value.view(getPositionCount());
	}

	public String viewActureCount(DBConnection con) throws Exception
	{
		return Value.view(getActureCount());
	}

	public String viewStatus(DBConnection con) throws Exception
	{
		return Value.view(getStatus());
	}

	public String viewCreateUserId(DBConnection con) throws Exception
	{
		return Value.view(getCreateUserId());
	}

	public String viewCreateUser(DBConnection con) throws Exception
	{
		return Value.view(getCreateUser());
	}

	public String viewCreateTime(DBConnection con) throws Exception
	{
		return Value.view(getCreateTime());
	}

	public String viewLastUpdateUserId(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUserId());
	}

	public String viewLastUpdateUser(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateUser());
	}

	public String viewLastUpdateTime(DBConnection con) throws Exception
	{
		return Value.view(getLastUpdateTime());
	}

	public String viewIsSync(DBConnection con) throws Exception
	{
		return Value.view(getIsSync());
	}

	public String viewSubRemark(DBConnection con) throws Exception
	{
		return Value.view(getSubRemark());
	}



protected CheckSubBase()
{
}

public void fill(CheckSubPageData pageData) throws Exception
{

	if(pageData.getId()!=null)
	{	
		setId(pageData.getId());
	}

	if(pageData.getCheckBillId()!=null)
	{	
		setCheckBillId(pageData.getCheckBillId());
	}

	if(pageData.getCheckBillCode()!=null)
	{	
		setCheckBillCode(pageData.getCheckBillCode());
	}

	if(pageData.getPositionCode()!=null)
	{	
		setPositionCode(pageData.getPositionCode());
	}

	if(pageData.getPositionName()!=null)
	{	
		setPositionName(pageData.getPositionName());
	}

	if(pageData.getProductId()!=null)
	{	
		setProductId(pageData.getProductId());
	}

	if(pageData.getProductCode()!=null)
	{	
		setProductCode(pageData.getProductCode());
	}

	if(pageData.getProductName()!=null)
	{	
		setProductName(pageData.getProductName());
	}

	if( pageData.getPositionCount()!=null && 
	   !pageData.getPositionCount().equals(""))
	{	
		setPositionCount(Double.parseDouble(pageData.getPositionCount()));
	}

	if( pageData.getActureCount()!=null && 
	   !pageData.getActureCount().equals(""))
	{	
		setActureCount(Double.parseDouble(pageData.getActureCount()));
	}

	if(pageData.getStatus()!=null)
	{	
		setStatus(pageData.getStatus());
	}

	if(pageData.getCreateUserId()!=null)
	{	
		setCreateUserId(pageData.getCreateUserId());
	}

	if(pageData.getCreateUser()!=null)
	{	
		setCreateUser(pageData.getCreateUser());
	}

	if(pageData.getCreateTime()!=null)
	{	
		setCreateTime(pageData.getCreateTime());
	}

	if(pageData.getLastUpdateUserId()!=null)
	{	
		setLastUpdateUserId(pageData.getLastUpdateUserId());
	}

	if(pageData.getLastUpdateUser()!=null)
	{	
		setLastUpdateUser(pageData.getLastUpdateUser());
	}

	if(pageData.getLastUpdateTime()!=null)
	{	
		setLastUpdateTime(pageData.getLastUpdateTime());
	}

	if(pageData.getIsSync()!=null)
	{	
		setIsSync(pageData.getIsSync());
	}

	if(pageData.getSubRemark()!=null)
	{	
		setSubRemark(pageData.getSubRemark());
	}

}

public String getTableName() 
{
	return TABLE_NAME;
}

public String getBackupTableName() 
{
	return BACKUP_TABLE_NAME;
}

public String getBackupSeqName() 
{
	return BACKUP_SEQ_NAME;
}

public java.util.Vector getFields() 
{
	if(m_fields==null)
	{
		m_fields = new Vector();

		m_fields.add(new Field(ID,Value.TYPE_STRING,true,true,32,"ID"));

		m_fields.add(new Field(CHECK_BILL_ID,Value.TYPE_STRING,false,true,32,"盘点单ID"));

		m_fields.add(new Field(CHECK_BILL_CODE,Value.TYPE_STRING,false,true,30,"盘点单编码"));

		m_fields.add(new Field(POSITION_CODE,Value.TYPE_STRING,false,true,30,"货位编码"));

		m_fields.add(new Field(POSITION_NAME,Value.TYPE_STRING,false,false,50,"货位名称"));

		m_fields.add(new Field(PRODUCT_ID,Value.TYPE_STRING,false,true,32,"产品ID"));

		m_fields.add(new Field(PRODUCT_CODE,Value.TYPE_STRING,false,true,30,"产品编码"));

		m_fields.add(new Field(PRODUCT_NAME,Value.TYPE_STRING,false,false,50,"产品名称"));

		m_fields.add(new Field(POSITION_COUNT,Value.TYPE_DOUBLE,false,true,0,"货位库存数量"));

		m_fields.add(new Field(ACTURE_COUNT,Value.TYPE_DOUBLE,false,true,0,"实际数量"));

		m_fields.add(new Field(STATUS,Value.TYPE_STRING,false,true,1,"是否有效"));

		m_fields.add(new Field(CREATE_USER_ID,Value.TYPE_STRING,false,true,32,"创建用户ID"));

		m_fields.add(new Field(CREATE_USER,Value.TYPE_STRING,false,false,50,"创建用户"));

		m_fields.add(new Field(CREATE_TIME,Value.TYPE_STRING,false,false,20,"单证创建时间"));

		m_fields.add(new Field(LAST_UPDATE_USER_ID,Value.TYPE_STRING,false,true,32,"最后修改人ID"));

		m_fields.add(new Field(LAST_UPDATE_USER,Value.TYPE_STRING,false,false,50,"最后修改人"));

		m_fields.add(new Field(LAST_UPDATE_TIME,Value.TYPE_STRING,false,false,20,"最后修改时间"));

		m_fields.add(new Field(IS_SYNC,Value.TYPE_STRING,false,true,1,"是否同步"));

		m_fields.add(new Field(SUB_REMARK,Value.TYPE_STRING,false,false,200,"备注"));
		
	}
	return m_fields;
}

public void initObject(java.sql.ResultSet rs) throws Exception
{

	m_id = getString(rs,ID);

	m_check_bill_id = getString(rs,CHECK_BILL_ID);

	m_check_bill_code = getString(rs,CHECK_BILL_CODE);

	m_position_code = getString(rs,POSITION_CODE);

	m_position_name = getString(rs,POSITION_NAME);

	m_product_id = getString(rs,PRODUCT_ID);

	m_product_code = getString(rs,PRODUCT_CODE);

	m_product_name = getString(rs,PRODUCT_NAME);

	m_position_count = getDouble(rs,POSITION_COUNT);

	m_acture_count = getDouble(rs,ACTURE_COUNT);

	m_status = getString(rs,STATUS);

	m_create_user_id = getString(rs,CREATE_USER_ID);

	m_create_user = getString(rs,CREATE_USER);

	m_create_time = getString(rs,CREATE_TIME);

	m_last_update_user_id = getString(rs,LAST_UPDATE_USER_ID);

	m_last_update_user = getString(rs,LAST_UPDATE_USER);

	m_last_update_time = getString(rs,LAST_UPDATE_TIME);

	m_is_sync = getString(rs,IS_SYNC);

	m_sub_remark = getString(rs,SUB_REMARK);

	ms_new_flag = ConstDefine.NO;
}

public Value get(String f)
{

	if(f.equalsIgnoreCase(ID))
	{
		return new Value(getId());
	}

	if(f.equalsIgnoreCase(CHECK_BILL_ID))
	{
		return new Value(getCheckBillId());
	}

	if(f.equalsIgnoreCase(CHECK_BILL_CODE))
	{
		return new Value(getCheckBillCode());
	}

	if(f.equalsIgnoreCase(POSITION_CODE))
	{
		return new Value(getPositionCode());
	}

	if(f.equalsIgnoreCase(POSITION_NAME))
	{
		return new Value(getPositionName());
	}

	if(f.equalsIgnoreCase(PRODUCT_ID))
	{
		return new Value(getProductId());
	}

	if(f.equalsIgnoreCase(PRODUCT_CODE))
	{
		return new Value(getProductCode());
	}

	if(f.equalsIgnoreCase(PRODUCT_NAME))
	{
		return new Value(getProductName());
	}

	if(f.equalsIgnoreCase(POSITION_COUNT))
	{
		return new Value(getPositionCount());
	}

	if(f.equalsIgnoreCase(ACTURE_COUNT))
	{
		return new Value(getActureCount());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		return new Value(getStatus());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		return new Value(getCreateUserId());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		return new Value(getCreateUser());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		return new Value(getCreateTime());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		return new Value(getLastUpdateUserId());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		return new Value(getLastUpdateUser());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		return new Value(getLastUpdateTime());
	}

	if(f.equalsIgnoreCase(IS_SYNC))
	{
		return new Value(getIsSync());
	}

	if(f.equalsIgnoreCase(SUB_REMARK))
	{
		return new Value(getSubRemark());
	}
	
	return null;
}
public void set(String f,Value v) throws Exception
{

	if(f.equalsIgnoreCase(ID))
	{
		setId(v.getString());
	}

	if(f.equalsIgnoreCase(CHECK_BILL_ID))
	{
		setCheckBillId(v.getString());
	}

	if(f.equalsIgnoreCase(CHECK_BILL_CODE))
	{
		setCheckBillCode(v.getString());
	}

	if(f.equalsIgnoreCase(POSITION_CODE))
	{
		setPositionCode(v.getString());
	}

	if(f.equalsIgnoreCase(POSITION_NAME))
	{
		setPositionName(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_ID))
	{
		setProductId(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_CODE))
	{
		setProductCode(v.getString());
	}

	if(f.equalsIgnoreCase(PRODUCT_NAME))
	{
		setProductName(v.getString());
	}

	if(f.equalsIgnoreCase(POSITION_COUNT))
	{
		setPositionCount(v.getDouble());
	}

	if(f.equalsIgnoreCase(ACTURE_COUNT))
	{
		setActureCount(v.getDouble());
	}

	if(f.equalsIgnoreCase(STATUS))
	{
		setStatus(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER_ID))
	{
		setCreateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_USER))
	{
		setCreateUser(v.getString());
	}

	if(f.equalsIgnoreCase(CREATE_TIME))
	{
		setCreateTime(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER_ID))
	{
		setLastUpdateUserId(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_USER))
	{
		setLastUpdateUser(v.getString());
	}

	if(f.equalsIgnoreCase(LAST_UPDATE_TIME))
	{
		setLastUpdateTime(v.getString());
	}

	if(f.equalsIgnoreCase(IS_SYNC))
	{
		setIsSync(v.getString());
	}

	if(f.equalsIgnoreCase(SUB_REMARK))
	{
		setSubRemark(v.getString());
	}
	
}
public String toString()
{
	String msg = "CheckSub=\n";
	msg += "(\r\n";

	msg += "    ID(id)="+get("id")+"\r\n";

	msg += "    盘点单ID(check_bill_id)="+get("check_bill_id")+"\r\n";

	msg += "    盘点单编码(check_bill_code)="+get("check_bill_code")+"\r\n";

	msg += "    货位编码(position_code)="+get("position_code")+"\r\n";

	msg += "    货位名称(position_name)="+get("position_name")+"\r\n";

	msg += "    产品ID(product_id)="+get("product_id")+"\r\n";

	msg += "    产品编码(product_code)="+get("product_code")+"\r\n";

	msg += "    产品名称(product_name)="+get("product_name")+"\r\n";

	msg += "    货位库存数量(position_count)="+get("position_count")+"\r\n";

	msg += "    实际数量(acture_count)="+get("acture_count")+"\r\n";

	msg += "    是否有效(status)="+get("status")+"\r\n";

	msg += "    创建用户ID(create_user_id)="+get("create_user_id")+"\r\n";

	msg += "    创建用户(create_user)="+get("create_user")+"\r\n";

	msg += "    单证创建时间(create_time)="+get("create_time")+"\r\n";

	msg += "    最后修改人ID(last_update_user_id)="+get("last_update_user_id")+"\r\n";

	msg += "    最后修改人(last_update_user)="+get("last_update_user")+"\r\n";

	msg += "    最后修改时间(last_update_time)="+get("last_update_time")+"\r\n";

	msg += "    是否同步(is_sync)="+get("is_sync")+"\r\n";

	msg += "    备注(sub_remark)="+get("sub_remark")+"\r\n";
		
	msg += ")\r\n";
	return msg;
}
public void copyBase(CheckSubBase srcObj)
{

	setCheckBillId(srcObj.getCheckBillId());

	setCheckBillCode(srcObj.getCheckBillCode());

	setPositionCode(srcObj.getPositionCode());

	setPositionName(srcObj.getPositionName());

	setProductId(srcObj.getProductId());

	setProductCode(srcObj.getProductCode());

	setProductName(srcObj.getProductName());

	setPositionCount(srcObj.getPositionCount());

	setActureCount(srcObj.getActureCount());

	setStatus(srcObj.getStatus());

	setCreateUserId(srcObj.getCreateUserId());

	setCreateUser(srcObj.getCreateUser());

	setCreateTime(srcObj.getCreateTime());

	setLastUpdateUserId(srcObj.getLastUpdateUserId());

	setLastUpdateUser(srcObj.getLastUpdateUser());

	setLastUpdateTime(srcObj.getLastUpdateTime());

	setIsSync(srcObj.getIsSync());

	setSubRemark(srcObj.getSubRemark());

}

public String toXml() throws Exception
{
	String xml = "";
	xml += "<CheckSub>";

	xml += "<Id>"+Value.view(getId())+"</Id>";

	xml += "<CheckBillId>"+Value.view(getCheckBillId())+"</CheckBillId>";

	xml += "<CheckBillCode>"+Value.view(getCheckBillCode())+"</CheckBillCode>";

	xml += "<PositionCode>"+Value.view(getPositionCode())+"</PositionCode>";

	xml += "<PositionName>"+Value.view(getPositionName())+"</PositionName>";

	xml += "<ProductId>"+Value.view(getProductId())+"</ProductId>";

	xml += "<ProductCode>"+Value.view(getProductCode())+"</ProductCode>";

	xml += "<ProductName>"+Value.view(getProductName())+"</ProductName>";

	xml += "<PositionCount>"+Value.view(getPositionCount())+"</PositionCount>";

	xml += "<ActureCount>"+Value.view(getActureCount())+"</ActureCount>";

	xml += "<Status>"+Value.view(getStatus())+"</Status>";

	xml += "<CreateUserId>"+Value.view(getCreateUserId())+"</CreateUserId>";

	xml += "<CreateUser>"+Value.view(getCreateUser())+"</CreateUser>";

	xml += "<CreateTime>"+Value.view(getCreateTime())+"</CreateTime>";

	xml += "<LastUpdateUserId>"+Value.view(getLastUpdateUserId())+"</LastUpdateUserId>";

	xml += "<LastUpdateUser>"+Value.view(getLastUpdateUser())+"</LastUpdateUser>";

	xml += "<LastUpdateTime>"+Value.view(getLastUpdateTime())+"</LastUpdateTime>";

	xml += "<IsSync>"+Value.view(getIsSync())+"</IsSync>";

	xml += "<SubRemark>"+Value.view(getSubRemark())+"</SubRemark>";
	
	xml += "</CheckSub>";
	return xml;
}

}
